<%@ Page MasterPageFile="~/Style/FrontEnd/FrontEnd.master" Language="C#" AutoEventWireup="true" CodeBehind="Checkout.aspx.cs" Inherits="OnlineFloralShop.Checkout" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
    #bigtitle{
        border-top:1px solid #F3F3F3; border-bottom:1px solid #F3F3F3; font-weight: bold; font-size: 16px; padding: 3px 0px;
        margin-bottom: 2px;
    }
    #cart_submit .title{
        height:27px; text-align: center; vertical-align: middle;
        border-bottom: 1px solid #F3F3F3;
        border-left: 1px solid #F3F3F3;
        border-top: 1px solid #F3F3F3;
        background: #FFFFB0;
        font-size: 13px;
    }
    #cart_submit .content{
        padding:3px 0px;
        text-align: center; vertical-align: middle;
        border-bottom: 1px solid #F3F3F3;
        border-left: 1px solid #F3F3F3;
    }
    #cart_submit .button{
        height: 40px; text-align: right; vertical-align: middle; background: none; border: none;
        padding: 0px; margin: 0px;
    }
    .buttonviewdetail{
        border:none;
        cursor: pointer;
        font-size:12px;
        background: #333333;
        padding: 3px 12px;
        color: #FFFFFF;
        font-weight: bold;
    }
    .buttonviewdetail:hover{
        border:none;
        cursor: pointer;
        font-size:12px;
        background: #999999;
        padding: 2px 11px;
        color: #333333;
        text-decoration: none;
        border:1px solid #333333;
        font-weight: bold;
    }
    .viewdetail{
        font-size:12px;
        background: #333333;
        padding: 4px 12px;
        color: #FFFFFF;
        text-decoration: none;
    }
    .viewdetail:hover, .viewdetail:active, .viewdetail:focus{
        font-size:12px;
        background: #999999;
        padding: 3px 11px;
        color: #333333;
        text-decoration: none;
        border:1px solid #333333;
    }

</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentMain" runat="server">

    <asp:MultiView ID="MultiView_Checkout" runat="server" ActiveViewIndex="0">
    
    <!--View 1 - Shipping-->
        <asp:View runat="server" ID="Shipping">
        <p style="margin-top:0px;margin-bottom:5px; font-size:13px;"><b>1.Billing & Shipping Details</b>&ensp;&ensp;&ensp;&ensp;2.Order Confirmation & Payment</p>
        <div class="Comment">
                <p class="bigtitle_">DELIVERY INFORMATION</p>
                <p style="background-color:#57b9e7;padding:6px;color:#FFFFFF"><b>Shipping Address</b></p>
                
                <!--Account's Address-->
                <div class="CommentList">
                <p><u><b>My Address</b></u></p>
                    <p>Name:<asp:Label ID="lbName" runat="server" Text=""></asp:Label><br />
                    Address:<asp:Label ID="lbAddress" runat="server" Text=""></asp:Label><br />
                    Phone:<asp:Label ID="lbPhone" runat="server" Text=""></asp:Label><br />
                    Location:<asp:Label ID="lbLocation" runat="server" Text=""></asp:Label><br />
                    Sex:<asp:Label ID="lbSex" runat="server" Text=""></asp:Label><br />
                    Email:<asp:Label ID="lbEmail" runat="server" Text=""></asp:Label><br /></p>
                </div>
                <!--Account's Address-->
                    
                <!--Choose Shipping Address-->
                    <asp:RadioButton Font-Bold="true" ID="rbtnSameAddress" GroupName="1" runat="server" 
                        Checked="True" Text="Use My Address" />	&ensp;	&ensp;	&ensp;<asp:RadioButton GroupName="1"  ID="rbtnNewAddress"
                        runat="server" Font-Bold="true" Text="Change Address" />
                <!--Choose Shipping Address-->
                
                <!--New Shipping Address-->
                 <div class="CommentList">
                    <asp:Panel ID="pnNewAddressShipping" runat="server">
                        <p style="text-align:right; margin:0px">&ensp;<span style="color:Red">(*)</span> Information required.</p>
                        <b><u>New Shipping Address</u></b>
                        <p>Name&ensp;<span style="color:Red">(*)</span><br />
                            <asp:TextBox ID="txtName" Width="200" runat="server"></asp:TextBox>
                        </p>
                        <p>Email&ensp;<span style="color:Red">(*)</span><br />
                            <asp:TextBox ID="txtEmail" Width="200" runat="server"></asp:TextBox>
                        </p>
                        <p>Phone&ensp;<span style="color:Red">(*)</span><br />
                            <asp:TextBox ID="txtPhone" Width="200" runat="server"></asp:TextBox>
                        </p>
                        <p>Sex&ensp;<span style="color:Red">(*)</span><br />
                            <asp:DropDownList ID="drpSex" runat="server">
                                <asp:ListItem Text="Male" Value="Male"></asp:ListItem>
                                <asp:ListItem Text="Female" Value="Female"></asp:ListItem>
                            </asp:DropDownList>    
                        </p>
                        <p>Address&ensp;<span style="color:Red">(*)</span><br />
                            <asp:TextBox ID="txtAddress" Width="400" TextMode="MultiLine" runat="server"></asp:TextBox></p>
                        <p>Location&ensp;<span style="color:Red">(*)</span><br />
                            <asp:DropDownList ID="drpLocation" runat="server">
                            </asp:DropDownList>
                        </p>
                        
                        <asp:Label ID="lbnotify" runat="server" Text="" Font-Italic="True" ForeColor="#CC0000"></asp:Label>
                    </asp:Panel>
                </div>
                <!--New Shipping Address-->
                 
                 
                <br />
                 <!--Delivery Preferences-->
                <p style="background-color:#57b9e7;padding:6px;color:#FFFFFF"><b>Delivery Preferences&ensp;</b>(optional)</p>
                <div class="CommentList">
                <p><b><u>Approximate date of delivery</u></b></p>
                    <p><asp:RadioButton ID="rbtnEarliest" Checked="true" Text="At the earliest" GroupName="choosedate" runat="server" /><br />
                    <i>Flowers & Cakes in India (selected locations): 24 hours.
Other gifts in major Indian cities & metros: 3-5 working days.
Remote & International deliveries: 7-10 working days.</i></p>
                    <asp:RadioButton GroupName="choosedate" Text="Approximate date of delivery preferred" ID="rbtnApproximate" runat="server" />
                    <asp:Panel ID="pnApproximate" runat="server">
                        &ensp;	&ensp;	&ensp;<asp:TextBox ID="txtDateDelivery" runat="server"></asp:TextBox>&ensp;<asp:ImageButton ImageUrl="~/Style/FrontEnd/images/calendar.png" ID="imgbtnCalendarDelivery"
                            runat="server" />
                        <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDateDelivery" PopupButtonID="imgbtnCalendarDelivery" PopupPosition="TopRight">
                        </asp:CalendarExtender>
                    </asp:Panel>
                </div>
                <br />
                
                <div class="CommentList">
                <!--AJAX load message from data-->
                <p><b><u>Message</u></b></p>
                    <asp:UpdatePanel ID="UpdatePanel_SelectMessage" runat="server">
                    <ContentTemplate>
                    Select Message Categoty: <asp:DropDownList AutoPostBack="true" ID="drpMessage" runat="server" 
                            onselectedindexchanged="drpMessage_SelectedIndexChanged">
                    </asp:DropDownList>
                    <br /><br />
                    Select Message: <asp:DropDownList Width="450" ID="drpMessageListByCaegoryId" runat="server">
                    </asp:DropDownList>
                        <asp:Label ID="abc" runat="server" Text=""></asp:Label>
                    </ContentTemplate>
                    </asp:UpdatePanel>
                    <br /><br />
                    OR<br /><br />
                    
                    <asp:TextBox Width="404px"  ID="txtMessage" TextMode="MultiLine" runat="server" 
                        Height="84px"></asp:TextBox><br />
                    <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="txtMessage" WatermarkText="Write message...">
                    </asp:TextBoxWatermarkExtender>
                   <!--AJAX load message from data-->
                </div>
               <!--Delivery Preferences--> 
               
             
             <!--CollapsiblePanelExtender 	Approximate date of delivery preferred-->
                <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender2" runat="Server"  
                TargetControlID="pnApproximate"  
                CollapsedSize="0"  
                ExpandedSize="50"  
                Collapsed="True"  
                ExpandControlID="rbtnApproximate"  
                CollapseControlID="rbtnEarliest"  
                AutoCollapse="False"  
                AutoExpand="False"  
                ScrollContents="True"  
                TextLabelID="Label1"  
                CollapsedText="Show Details..."  
                ExpandedText="Hide Details"   
                ImageControlID="Image1"  
                ExpandDirection="Vertical" />  
                <!--CollapsiblePanelExtender 	Approximate date of delivery preferred-->
                
                <!--CollapsiblePanelExtender ADDRESS-->
                <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="Server"  
                TargetControlID="pnNewAddressShipping"  
                CollapsedSize="0"  
                ExpandedSize="400"  
                Collapsed="True"  
                ExpandControlID="rbtnNewAddress"  
                CollapseControlID="rbtnSameAddress"  
                AutoCollapse="False"  
                AutoExpand="False"  
                ScrollContents="True"  
                TextLabelID="Label1"  
                CollapsedText="Show Details..."  
                ExpandedText="Hide Details"   
                ImageControlID="Image1"  
                ExpandDirection="Vertical" />  
                <!--CollapsiblePanelExtender ADDRESS-->
          
            <p style="text-align:right"><asp:Button CssClass="viewdetail" ID="btnShipNext" runat="server" Text="Next" 
                 onclick="btnShipNext_Click" /></p>
        </div>  
        </asp:View>
        <!--View 1 - Shipping-->
        
        
        <!--View 2 - Payment-->
        <asp:View ID="Payment" runat="server">
            <p style="text-align:center"><asp:Label ID="lbConfrimMessage" runat="server" Text="" ForeColor="#CC0000"></asp:Label></p>
                <p style="margin-top:0px;margin-bottom:5px; font-size:13px;">1.Billing & Shipping Details&ensp;&ensp;&ensp;&ensp;<b>2.Order Confirmation & Payment</b></p>

            <div class="Comment">
                <p class="bigtitle_">ORDER CONFIRMATION & PAYMENT</p>
                <p style="background-color:#57b9e7;padding:6px;color:#FFFFFF"><b>Cart</b></p>
                
                <!--Cart details-->
                <div id="cart_submit">
                    <asp:ListView ID="ListView_Cart" runat="server">
                        <LayoutTemplate>
                        <table width="100%" cellspacing="0" cellpadding="0">
                            <tbody><tr>
                            <td class="title">Picture</td>
                            <td class="title">Bouquest name</td>
                            <td class="title">Price</td>
                            <td class="title">Quantity</td>
                            <td class="title">Total</td>
                            </tr>
                            <div ID="itemPlaceholder" runat="server" ></div>
                            </tbody>
                        </table>
                        </LayoutTemplate>
                        <ItemTemplate>
                        <tr>

                        <td class="content"><img id="Img1" width="100" height="100" alt='' runat="server" src='<%# Model.Catalog.Product.GetProductDetailByProductId(Eval("Key").ToString()).Rows[0]["Images"].ToString() %>' border="0" /></td>
                        <td class="content"><a href='Product/Details.aspx?ProductId=<%# Eval("Key") %>'><asp:Label ID="lbProductName" runat="server" Text='<%# Model.Catalog.Product.GetProductDetailByProductId(Eval("Key").ToString()).Rows[0]["ProductName"].ToString() %>'></asp:Label><br>(
                        <asp:Label ID="lbProId" runat="server" Text='<%# Eval("Key") %>'></asp:Label>)</a></td>
                        <td style="color: #BB0000;" class="content"><%# decimal.Floor(decimal.Parse(Model.Catalog.Product.GetProductDetailByProductId(Eval("Key").ToString()).Rows[0]["Price"].ToString()))%> $</td>
                        <td class="content"><asp:Label ID="lbQuantity" runat="server" Text='<%# Eval("Value") %>'>'></asp:Label><br /></td>
                        <td style="color: #BB0000;" class="content"><%# decimal.Floor(decimal.Parse(Model.Catalog.Product.GetProductDetailByProductId(Eval("Key").ToString()).Rows[0]["Price"].ToString()) * decimal.Parse(Eval("Value").ToString()))%> $</td>
                        </tr>
                        

                        </ItemTemplate>
                    </asp:ListView>
                    <table width="100%" cellspacing="0" cellpadding="0">
                       <tr>
                            <td width="85%" align="right">
                            <b>Sub - total:</b><br />
                            <b>Phivanchuyen:</b><br />
                            <b>Total:</b>
                            </td>
                            <td width="15%" align="right">
                            <asp:Label ID="lbSub_total" runat="server" Text=""></asp:Label>
                            <br />
                                <asp:Label ID="lbCost" runat="server" Text=""></asp:Label>
                            <br />
                                <asp:Label ID="lbTotal" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                      </table>
                </div>
                <!--Cart details-->
                <br />
                
                <!--Payment & Shipping Details-->
                <p style="background-color:#57b9e7;padding:6px;color:#FFFFFF"><b>Payment & Shipping Details</b></p>
                <div class="CommentList">
                 <table width="100%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                        <p><u><b>Payment Address</b></u></p>
                        <p>Name:&ensp;<asp:Label ID="lbPayName" runat="server" Text=""></asp:Label><br />
                        Address:&ensp;<asp:Label ID="lbPayAdd" runat="server" Text=""></asp:Label><br />
                        Phone:&ensp;<asp:Label ID="lbPayPhone" runat="server" Text=""></asp:Label><br />
                        Location:&ensp;<asp:Label ID="lbPayLocation" runat="server" Text=""></asp:Label><br />
                        Sex:&ensp;<asp:Label ID="lbPaySex" runat="server" Text=""></asp:Label><br />
                        Email:&ensp;<asp:Label ID="lbPayEmail" runat="server" Text=""></asp:Label><br /></p>
                        </td>
                        
                        <td>
                        <p><u><b>Shipping Address</b></u></p>
                        <p>Name:&ensp;<asp:Label ID="lbShipName" runat="server" Text=""></asp:Label><br />
                        Address:&ensp;<asp:Label ID="lbShipAdd" runat="server" Text=""></asp:Label><br />
                        Phone:&ensp;<asp:Label ID="lbShipPhone" runat="server" Text=""></asp:Label><br />
                        Location:&ensp;<asp:Label ID="lbShipLocation" runat="server" Text=""></asp:Label><br />
                        Sex:&ensp;<asp:Label ID="lbShipSex" runat="server" Text=""></asp:Label><br />
                        Email:&ensp;<asp:Label ID="lbShipEmail" runat="server" Text=""></asp:Label><br /></p>
                        </td>
                    </tr>
                </table>
                </div>
                <!--Payment & Shipping Details-->
                <br />
                
                
                 <!--Payment method-->
                <p style="background-color:#57b9e7;padding:6px;color:#FFFFFF"><b>Payment Method&ensp;</b>(Credit Card)</p>
                <div class="CommentList">
                    <p><b>Credit card type:</b> <asp:DropDownList ID="drpCreditTypr" runat="server">
                    <asp:ListItem Text="Master Card" Value="MASTER"></asp:ListItem>
                    <asp:ListItem Text="Visa Card" Value="VISA"></asp:ListItem>
                    <asp:ListItem Text="Discovery Card" Value="DISCO"></asp:ListItem>
                        </asp:DropDownList>
                    </p>
                    <p><b>Credit card number:</b>  <asp:TextBox ID="txtCreditCardNumber" Width="200" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                            ID="RequiredFieldValidator_cardnumber" ValidationGroup="cardnumber" ControlToValidate="txtCreditCardNumber" runat="server" ErrorMessage="Required CardNumber"></asp:RequiredFieldValidator><asp:RegularExpressionValidator
                                ID="RegularExpressionValidator_number" runat="server" ValidationGroup="cardnumber" ControlToValidate="txtCreditCardNumber" ErrorMessage="Only digits" ValidationExpression="\d*"></asp:RegularExpressionValidator></p>
                </div>
        
                <!--Payment method--> 
 
        </div>  
        
         <div style="margin-top:5px">   
            <div style="float:left"><asp:Button CssClass="viewdetail" ID="btnPayPrev" 
                    runat="server" Text="Prev" onclick="btnPayPrev_Click" /></div><div style="float:right">I have read and agree to the Terms & Conditions 
                        <asp:CheckBox ID="cbxAcceptOrder" runat="server" /><asp:Button ValidationGroup="cardnumber" ID="btnPayNext" runat="server" CssClass="viewdetail" Text="Confrim Order" 
                onclick="btnPayNext_Click" /></div>
                 <br style="clear:both" />
         </div>
        </asp:View>
        <!--View 2 - Payment-->
        
        
        <!--View 3 - Success-->
        <asp:View ID="Confrim" runat="server">
        <p style="background-color:#57b9e7;padding:6px;color:#FFFFFF"><b>Your Order Has Been Processed!</b></p>
        <div class="CommentList">
            <p>Your order has been successfully processed! <br />
               You can view your order history by going to the <a runat="server" href="~/Account/" title="My Account">My Account</a><br />

               Please direct any <a href="~/Contact.aspx" runat="server" title="Contact">questions </a> have to the store owner.<br />

               Thanks for shopping with us online!";</p>
          <p style="text-align:right"><a class="viewdetail" href="~/Default.aspx" runat="server" title="Home">Continue</a></p>
        </div>   
        </asp:View>
        <!--View 3 - Success-->

    </asp:MultiView>
   
       
</asp:Content>